<template>
  <div>
    <el-dialog
      v-if="showWin"
      v-dialogDrag="showWin"
      :title="formTitle"
      :close-on-click-modal="false"
      :visible.sync="showWin"
      width="90%">
      <el-form
        id="form"
        ref="form"
        :rules="rules"
        :model="form"
        label-width="auto">
        <el-row :gutter="20">
          <el-col :span="6">
            <el-form-item
              label="归档标记 :"
              prop="archiveFlag">
              <el-input v-model="form.archiveFlag" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="产品规范码 :"
              prop="psrNum">
              <el-input
                v-model="form.psrNum"
                :disabled="formTitle === '修改'" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="维护日期 :"
              prop="lastDate">
              <el-date-picker
                v-model="form.lastDate"
                :picker-options="pickerOptions"
                :popper-class="'currentDatePickerClass'"
                style="width: 100%;"
                type="date"
                align="right"
                value-format="yyyyMMdd"
                placeholder="选择日期" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="维护者 :"
              prop="userId">
              <el-input v-model="form.userId" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="切边形态 :"
              prop="edgeType">
              <el-input v-model="form.edgeType" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="封锁区分 :"
              prop="holdingDiv">
              <el-input v-model="form.holdingDiv" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="镀层计量方式 :"
              prop="guideMeasure">
              <el-input v-model="form.guideMeasure" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="质保书类型 :"
              prop="qcType">
              <el-input v-model="form.qcType" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="质保书份数 :"
              prop="qcNum">
              <el-input v-model="form.qcNum" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="验收部门 :"
              prop="checkDivision">
              <el-input v-model="form.checkDivision" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="计重方式 :"
              prop="weightMode">
              <el-input v-model="form.weightMode" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="轨梁产品截面代码 :"
              prop="railCode">
              <el-input v-model="form.railCode" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="轨梁产品截面描述 :"
              prop="railCodeDesc">
              <el-input v-model="form.railCodeDesc" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="合同单技术参数描述 :"
              prop="orderTechnicDesc">
              <el-input v-model="form.orderTechnicDesc" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="产品标识代码 :"
              prop="recogniseCode">
              <el-input v-model="form.recogniseCode" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span
        slot="footer"
        class="dialog-footer">
        <el-button @click="showWin = false">关 闭</el-button>
        <el-button
          v-oauth
          data-oauthUuid="1620438099000"
          type="primary"
          :loading="loading"
          @click="submit">提 交</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
  import { deepClone } from '@/utils/index'

  export default {
    data() {
      return {
        showWin: false,
        formTitle: '创建',
        rules: [],
        form: {}
      }
    },
    methods: {
      show(data) {
        if (data) {
          this.formTitle = '修改'
          this.form = deepClone(data)
        } else {
          this.formTitle = '创建'
          this.form = {

          }
        }
        this.showWin = true
      },
      closeWin() {
        this.showWin = false
        this.$emit('appendData', 'refreshChild')
      }
    }
  }
</script>

<style lang="scss" scoped>

</style>
